package com.bdq.interaction.infrastructure.persistence.mysql.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bdq.common.enums.YesOrNoEnum;
import com.bdq.interaction.infrastructure.persistence.mysql.pojo.InteractionVote;
import com.bdq.interaction.infrastructure.persistence.mysql.mapper.InteractionVoteMapper;
import com.bdq.interaction.infrastructure.persistence.mysql.service.InteractionVoteService;
import org.springframework.stereotype.Service;

/**
* @author malei
* @description 针对表【interaction_vote(交互投票表)】的数据库操作Service实现
* @createDate 2024-05-14 15:04:13
*/
@Service
public class InteractionVoteServiceImpl extends ServiceImpl<InteractionVoteMapper, InteractionVote>
    implements InteractionVoteService{

    @Override
    public InteractionVote getData(Long userId, Long contentId) {
        return lambdaQuery()
                .eq(InteractionVote::getUserId, userId)
                .eq(InteractionVote::getContentId, contentId)
                .eq(InteractionVote::getIsDeleted, YesOrNoEnum.NO.getCode())
                .one();
    }
}




